<%= javascript_include_tag "jquery.validate" %>
<script type="text/javascript">
  $(document).ready(function(){
    $("#alias").hide("fast");
    $("#badday").validate();
    $('.check_alias').click(function() {
      if ($(this).is(':checked')) {
        $("#alias").show("fast");
        $(".long").attr("style","height:450px;")
        $("#alias").attr("class","required");
      } else {
        $("#alias").hide("fast");
        $("#alias").attr("class","");
        $(".long").attr("style","height:300px;")
      }
    });
  });
</script>
<style type="text/css">
  .error {
    color:red;
    float:left;
  };
</style>
<div class="container">
  <p style="color:green;"><%= flash[:badday] if flash[:badday] %></p>
  <fieldset>
    <div class="boxy">
      <div class="long " style="height:250px">
        <a class="head">My Bad Day</a>
        <div class="forms ">
          <div class="clear c25">&nbsp;</div>
          <% form_tag baddays_path ,:id =>"badday" do %>
            <p><%= label_tag "message" %></p>
            <%= text_area_tag :message,"",:class =>"required" %>
            <%= check_box_tag :check_alias,"",false,{:class =>"check_alias"} %> alias
            <%= text_field_tag  :alias,"alias",:id=>"alias"%><br>
            <%= select("category", "id", Category.all.collect {|p| [ p.title, p.id ] }, {:prompt => 'Select Category'},{:id =>"category",:name =>"category",:class =>"required"}) %>
            <br>
            <%= submit_tag "OK" %>
          <%end%>
        </div>
      </div>
    </div>
  </fieldset>
</div>